using MeditRBlazorApp.Data;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddMvc();
builder.Services.AddSingleton<WeatherForecastService>();

WebApplication? app = builder.Build();

// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
    app.UseExceptionHandler("/Error");
}


app.UseStaticFiles();

app.UseRouting();

app.UseEndpoints(configure =>
{
    app.MapBlazorHub();

    configure.MapControllerRoute(
        name: "default",
        pattern: "{controller]/{action}");

    app.MapFallbackToPage("/_Host");
});

app.Run();
